﻿using System;

namespace Jlvier.TaobaoShowcase.Service
{
    internal class KeyTimeSpan
    {
        private readonly KeyTime beginTime;
        private readonly KeyTime endTime;

        public KeyTimeSpan(KeyTime beginTime,KeyTime endTime)
        {
            this.beginTime = beginTime;
            this.endTime = endTime;
        }

        public KeyTime EndTime
        {
            get { return endTime; }
        }

        public KeyTime BeginTime
        {
            get { return beginTime; }
        }
        public bool IsDuringKeyTime(DateTime dateTime)
        {
            var time = new KeyTime(dateTime.Hour,dateTime.Minute,dateTime.Second);
            return time >= beginTime && time <= endTime;
        }
    }
}